home *** CD-ROM | disk | FTP | other *** search
- /* $VER: 1.1 */
-
- options results /* enable return codes */
-
- if (left(address(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
-
- address 'GOLDED.1'
-
- 'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */
-
- if (RC ~= 0) then
-
- exit
-
- options failat 6 /* ignore warnings */
-
- signal on syntax /* ensure clean exit */
-
- /* ---------------------- INSERT YOUR CODE HERE ---------------------- */
-
- 'QUERY CAT'
-
- if (RESULT = "deutsch") then do
-
- STRING.sSCMSGERROR = "Kann SAS/C-Message-Browser nicht starten !"
- STRING.sSCOPTS = "Es wurde keine GTS-Datei in der Projekt-|konfiguration eingestellt !"
- STRING.sNOLIB = "rexxsupport.library nicht verfügbar !"
- STRING.sSRCFILE = "Quellcode nicht gefunden !"
- end
- else do
-
- STRING.sSCMSGERROR = "Can not start the SAS/C message browser !"
- STRING.sERROR = "Could not start SCMSG !"
- STRING.sSCOPTS = "Project configuration does not define|a GST file !"
- STRING.sNOLIB = "rexxsupport.library not availabale !"
- STRING.sSRCFILE = "Source code not found !"
- end
-
- 'QUERY PATH VAR=PATH'
-
- 'EXPAND NAME="' || PATH || '" VAR=PATH'
-
- R = pragma('D', PATH)
-
- GSTFILE = ""
-
- call readoptions("SAS/C")
-
- if (GSTFILE ~= "") then do
-
- /* find a source code for GST generation (must include all headers) */
-
- SRCFILE="gst.c"
-
- if (~exists(SRCFILE)) then
-
- SRCFILE = "makegst.c"
-
- if (~exists(SRCFILE)) then
-
- SRCFILE = "main.c"
-
- if (~exists(SRCFILE)) then do
-
- if (show('L', "rexxsupport.library") | addlib('rexxsupport.library', 0, -30, 0)) then do
-
- FILES = showdir(PATH, 'FILES')
-
- do while (FILES ~= "")
-
- parse UPPER VAR FILES NEXT FILES
-
- if (index(NEXT, ".c") ~= 0) then do
-
- SRCFILE = NEXT
-
- leave
- end
- end
-
- end
- else
- 'REQUEST PROBLEM="' || STRING.sNOLIB || '"'
- end
-
- if (exists(SRCFILE)) then do
-
- call run_scmsg
-
- /* compile file */
-
- 'FILE DELETE FORCE NAME="' || GSTFILE || '"'
-
- 'RUN ASYNC CMD="sc errorrexx makegst=*"' || GSTFILE || '*" *"' || SRCFILE || '*""'
- end
- else
- 'REQUEST PROBLEM="' || STRING.sSRCFILE || '"'
- end
- else
- 'REQUEST PROBLEM="' || STRING.sSCOPTS || '"'
-
- /* ------------------------- END OF YOUR CODE ------------------------ */
-
- 'UNLOCK'
-
- exit
-
- SYNTAX:
-
- SAY "Error in line" SIGL ":" ERRORTEXT(RC)
-
- 'UNLOCK'
-
- exit
-
- /* /// "readoptions" */
-
- readoptions: procedure expose CONFIG. STRING. PROJECTNAME OBJFOLDER GSTFILE
-
- /* read compiler-specific options file in project folder (if any exists) */
-
- parse upper arg SOFTWARE
-
- if ((SOFTWARE = "") | (SOFTWARE = "SAS/C") | (SOFTWARE = "SAS/C-GNUMAKE")) then do
-
- if (exists("scoptions")) then do
-
- if open('HANDLE', "scoptions", 'READ') then do
-
- do until eof('HANDLE')
-
- DATA = readln('HANDLE')
-
- if (upper(left(DATA, 12)) = "PROGRAMNAME=") then do
-
- PROJECTNAME = compress(substr(DATA, 13), '"')
- end
- else if (left(DATA, 11) = "OBJECTNAME=") then
-
- OBJFOLDER = compress(substr(DATA, 12), '"')
-
- else if (left(DATA, 18) = "GLOBALSYMBOLTABLE=") then
-
- GSTFILE = compress(substr(DATA, 19), '"')
- end
-
- R = close('HANDLE')
- end
- end
- end
-
- return
-
- /* /// */
- /* /// "run_scmsg" */
-
- run_scmsg: procedure EXPOSE STRING.
-
- /* update env variable to reflect path of current project */
-
- 'QUERY PATH VAR=PATH'
-
- 'EXPAND NAME="' || PATH || '" VAR=PATH'
-
- 'SET $sc/projdir "' || PATH || '"'
-
- /* show browser window ? */
-
- 'QUERY OPTIONBROWSER VAR=OPTIONBROWSER'
-
- /* direct SCMSG to show up on our screen */
-
- 'QUERY SCREEN VAR=PUBSCRNAME'
-
- if (show('P', 'SC_SCMSG')) then do
-
- if (OPTIONBROWSER = "TRUE") then
-
- address 'SC_SCMSG' 'opts screen ' || PUBSCRNAME
- end
- else do
-
- /* read and update SCMSG config file (update screen name and arexx port) */
-
- if (~exists("env:sc")) then
-
- 'FILE NEWDIR NAME="env:sc"'
-
- LINES = 0
-
- if open('SCMSG', 'env:sc/scmsg', 'READ') then do
-
- do until eof('SCMSG')
-
- DATA = readln('SCMSG')
-
- parse upper var DATA COMMAND .
-
- if ((COMMAND ~= "PORTNAME") & (COMMAND ~= "PUBSCREEN") & (COMMAND ~= "EDITCOMMAND") & (COMMAND ~= "GOTOFILE") & (COMMAND ~= "GOTOLINE")) then do
-
- LINES = LINES + 1
-
- CONFIG.LINES = DATA
- end
-
- end
-
- R = close('SCMSG')
- end
-
- /* save updated config file (with current port/pubscreen name) */
-
- if open('SCMSG', 'env:sc/scmsg', 'WRITE') then do
-
- PORTNAME = ADDRESS()
-
- R = writeln('SCMSG', "PORTNAME " || PORTNAME )
-
- R = writeln('SCMSG', "PUBSCREEN " || PUBSCRNAME)
-
- R = writeln('SCMSG', "GOTOFILE WINDOW USE=%f FORCE")
-
- R = writeln('SCMSG', "GOTOLINE GOTO INDENT LINE=%l UNFOLD=TRUE")
-
- R = writeln('SCMSG', "EDITCOMMAND golded:ed")
-
- if (LINES ~= 0) then do
-
- do LINE=1 to (LINES - 1)
-
- R = writeln('SCMSG', CONFIG.LINE)
- end
- end
-
- R = close('SCMSG')
- end
-
- /* run scmsg */
-
- if (exists("sc:c/scmsg")) then do
-
- COMMANDSTRING = 'sc:c/scmsg screen "' || PUBSCRNAME || '"'
-
- if (OPTIONBROWSER ~= "TRUE") then
-
- COMMANDSTRING = COMMANDSTRING || ' rexxonly'
-
- 'FIX VAR=COMMANDSTRING'
-
- 'RUN ASYNC CMD="' || COMMANDSTRING || '" WAITPORT="SC_SCMSG" SECONDS=10 DIR="' || PATH || '"'
- end
-
- if (~show('P', 'SC_SCMSG')) then do
-
- 'REQUEST PROBLEM="' || STRING.sSCMSGERROR || '"'
-
- 'UNLOCK'
-
- exit
- end
- end
-
- return
-
- /* /// */
-